<template>
	<view>
		<view class="p-3" v-if="dataList.length>0">
			<view class="bt-block mb-3" @click="gotoDetail(i)" v-for="i,idx in dataList">
				<bg-cell :showArrow="true" :border="false">
					<view>
						<bg-desc label="项目名称" :valueStyle="{width:'250rpx'}"  :value="i.projectName"></bg-desc>
						<bg-desc label="提交人"  :value="i.createByName "></bg-desc>
						<bg-desc label="提交时间"  :value="i.createTime "></bg-desc>
					</view>
				</bg-cell>
			</view>
		</view>
		<u-empty v-else></u-empty>
	</view>
</template>

<script>
	import { insuranceList } from '../../../api/apply'
	export default {
		onNavigationBarButtonTap() {
			uni.navigateTo({
				url:"/pages/more/insure/insure"
			})
		},
		mounted() {
			this.getData()
			uni.$on("refresh-page", ()=>{
				this.dataList = []
				this.params.pageNum = 1
				this.getData()
			})
		},
		data() {
			return {
				params:{
					pageNum:1,
					pageSize:20
				},
				dataList:[]
			}
		},
		methods: {
			getData(){
				insuranceList({}).then(res=>{
					this.dataList = res.data
				})
			},
			gotoDetail(i){
				uni.navigateTo({
					url:"/pages/more/insure/detail?id="+i.id
				})
			}
		}
	}
</script>

<style>

</style>
